package com.wxmit.module.system.web;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.wxmit.base.domain.ApiResult;
import com.wxmit.framework.web.operatelog.Log;
import com.wxmit.framework.web.operatelog.LogModule;
import com.wxmit.framework.web.operatelog.enums.BusinessType;
import com.wxmit.base.validate.AddGroup;
import com.wxmit.base.validate.UpdateGroup;
import com.wxmit.module.system.domain.SysDictData;
import com.wxmit.module.system.service.ISysDictDataService;
import com.wxmit.system.base.core.ShushanBaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 字典数据Controller
 * @author xiong
 * @date 2022-08-09
 */
@RestController
@RequestMapping("/system/data")
@LogModule("字典数据")
public class SysDictDataController extends ShushanBaseController<ISysDictDataService,SysDictData,Long> {

    @Autowired
    private ISysDictDataService sysDictDataService;

    public SysDictDataController(ISysDictDataService baseService){
        super(baseService,"system:data:");
    }

    /**
     *  根据类型获取字典数据 （通用）
     * @param type 类型
     * @return 字典数据
     */
    @GetMapping("/list/{type}")
    public List<SysDictData> getList(@PathVariable("type") String type)
    {
        return sysDictDataService.listByType(type);
    }

}